[loop cycle 5] fix(dnd): route AVIF/HEIF photos as photos; broaden MIME labels#13
Merged
Merged
Conversation
mime_for() drives how bridge.js routes a dropped file: an image/* MIME goes to the Photos & Videos composer, anything else to the Document composer. Modern phone photos in AVIF and HEIF fell through to application/octet-stream, so they were attached as plain files instead of photos. Map avif -> image/avif and heif -> image/heif (alongside the existing heic) so they route as photos. Conservatively, niche raster formats (TIFF, ICO, APNG) are deliberately left as documents: WhatsApp's photo composer may reject them, which would be worse than the current behaviour of sending them as a document file. Also add correct labels for many video (3g2, mpeg/mpg, mts/m2ts, ogv, flv), audio (flac, aac, weba, amr, mid/midi), and document/archive (rtf, odt/ods/odp, epub, md, json, xml, 7z, rar, tar, gz, apk) types. These all still route as documents (none are images or in the small native-video set), so labeling improves but routing is unchanged. Tests: avif/heif/heic resolve to image/*; tiff/ico/apng stay octet-stream (document); the new av/doc labels resolve; unknown extensions still fall back so the file always sends. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016o9cWBaPy4zU4BAurUVoTp
karem505
added a commit
that referenced
this pull request
Jun 28, 2026
Bundles six loop-shipped fixes: - perf(dnd): stream dropped files as base64 to cut peak memory on large videos (#9) - fix(notifications): forward service-worker showNotification to the native toast (#10) - feat(calls): expose a minimal window.chrome so WhatsApp enables call buttons (#11) - fix(notifications): de-duplicate burst-repeated native toasts (#12) - fix(dnd): route AVIF/HEIF photos as photos; broaden MIME labels (#13) - fix(calls/capability): return a complete Chrome high-entropy client-hints set (#14) Plus integration: SW notifications share the dedup window; base64_encode is test-only now. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016o9cWBaPy4zU4BAurUVoTp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A drag-and-drop routing fix.
mime_for()decides how a dropped file is attached:bridge.jssends animage/*MIME to the Photos & Videos composer and everything else to the Document composer. Modern phone photos in AVIF and HEIF were falling through toapplication/octet-stream, so they got attached as files instead of photos.How
avif → image/avif,heif → image/heif(alongside the existingheic) → they now route as photos.3g2, mpeg/mpg, mts/m2ts, ogv, flv), audio (flac, aac, weba, amr, mid/midi), and document/archive (rtf, odt/ods/odp, epub, md, json, xml, 7z, rar, tar, gz, apk) types. None are images or in the native-video set, so routing is unchanged — only the label improves (e.g. WhatsApp can render an audio preview).Verification
Gate 1 —
cargo build --locked+cargo test: PASS, 53 tests (2 new):modern_image_types_resolve_to_image_so_they_route_as_photos— avif/heif/heic →image/*; tiff/ico/apng stayoctet-stream(document).new_av_and_doc_types_have_specific_labels— flac/aac/mpeg/md/json/7z/epub labels + unknown-fallback.Gate 2 — generation-blind code review: APPROVE, severity none, no must-fix. Confirmed: no duplicate/unreachable arms; all MIME strings IANA/de-facto correct; routing-regression check clean (only avif/heif newly enter the media path, both supported); parsing normalizes correctly; the TIFF/ICO/APNG holdback is the right call.
🤖 PR-ONLY — do not auto-merge. Releasing whatRust is manual via a
v*tag; this loop never merges, bumps the version, or tags a release. Opened by thewhatrust-fix-loop(cycle 5/6).